package com.party.product.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.party.dto.Response;
import com.party.product.service.SiteCategoryService;
/**
 * 
 * @author Caizhf
 * @date 2017年8月31日上午11:32:50
 * @version v.0.1
 * @email 1115054416@qq.com 
 *
 * <p>Description: </p>
 *
 */
@RestController
@RequestMapping("/scate")
public class SiteCategoryController {
	
	@Autowired
	private SiteCategoryService service;
	
	/**
	 * 
	 * @param pageNum
	 * @param pageSize
	 * @return
	 */
	@RequestMapping("/list/{pageNum}")
	public Response list(@PathVariable int pageNum,@RequestParam("pageSize")int pageSize){
		return Response.success(service.list(pageNum,pageSize));
	}
	
	
	@RequestMapping("/get/{soid}")
	public Response get(@PathVariable Integer soid){
		return Response.success(service.findById(soid));
	}
	
	/**
	 * 根据板块id查找所有的场地
	 * @param pageNum
	 * @param pageSize
	 * @param soid
	 * @return
	 */
	@RequestMapping("/li_site/{soid}")
	public Response listSiteByCategoryId(@RequestParam("pageNum") int pageNum,@RequestParam("pageSize")int pageSize,@PathVariable Integer soid){
		return Response.success(service.listSiteByCategoryId(pageNum,pageSize,soid));
	}
	
}
